<?php
/*
| --------------------------------------------------------------------------------------------------
| <main_model>
| Desenvolvedor:	eduardo
| E-mail:		eduardo.sirangelo@21century.com.br
| Descrição:
|	- 
| Quality is Everyting
| --------------------------------------------------------------------------------------------------
*/
class Main_model extends Model {

    function Main_model()
    {
        // Chama o construtor do Model
        parent::Model();
    }

    function show_empresa() {
        $query = $this->db->query("SELECT * FROM tab_empresa ORDER BY id_empresa");
        return $query;
    }
    
    function get_menu_by_where($where) {
        $this->db->select('tab_menu.*');
        $this->db->from('tab_menu');
        $this->db->join('tab_rel_menu_user', 'tab_menu.id_menu = tab_rel_menu_user.id_menu');
        $this->db->order_by("tab_menu.id_menu");
        $this->db->where($where);
        return $this->db->get();
    }
    
    function check_permitions_by_where($where) {
        return $this->db->get_where("tab_rel_menu_permissoes",$where);
    }
    
    function get_programa_by_where($where) {
        return $this->db->get_where("tab_menu_programas",$where);
    }
}
?>
